""" System imports """
import os,sys
import logging

""" Other modules """
import pygame

""" Game """
#import resourcemanager

""" Constants """

""" Set up logging """
_log = logging.getLogger("epicquest.mixboard")
_log.debug("Initializing Mixboard")

class MixBoard():
    
    def __init__(self):
        pass

    def set_music(self, file):
        if file is not None:
            self.music_file = file
            pygame.mixer.music.load(self.music_file)
        else:
            if self.music_file is None:
                _log.error('Error loading music file. None provided.')
            else:
                pygame.mixer.music.load(self.music_file)            


    def play_music(self, file = None, loop_count = -1):
        self.set_music(file)
        pygame.mixer.music.play(loop_count)
        
    def pause_music(self):
        pygame.mixer.music.pause()
        
    def stop_music(self):
        pygame.mixer.music.stop()
        
    def fadeout_music(self, time = None):
        pygame.mixer.music.fadeout(time)
        
    def queue_music(self, file):
        pygame.mixer.music.queue(file)
        
    def set_volume(self, volume):
        pygame.mixer.music.set_volume(volume)
        
        
""" Global instances """
mixboard = MixBoard()